<template>
  <div class="app-container">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>时间：{{ this.dataTime }}</span>
      </div>

      <div id="print-div" style="" class="warp">
        <div
          style="
            text-align: center;
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 8px;
          "
        >
          <img src="@/icons/img/changzhi.png" style="width: 30px; height: 30px"/>{{ this.$store.state.City }}医院 <br/>ECMO建立/结束
          操作记录
        </div>
        <div
          style="
            line-height: 30px;
            font-size: 14px;
          "
        >
          <span style="display: inline-block;width: 50px">
            姓名：
          </span>
          <span
            style="
              display: inline-block;
              width: 70px;
              text-align: center;
              border-bottom: 1px solid rgb(220, 222, 226);
              height: 30px;
              margin-right: 5px;
            "
          >{{ this.data.name }}</span
          >
          <span style="display: inline-block;width: 50px">
            性别：
          </span>
          <span
            style="
              display: inline-block;
              width: 40px;
              text-align: center;
              border-bottom: 1px solid rgb(220, 222, 226);
              height: 30px;
              margin-right: 5px;
            "
          >{{ this.data.sex }}</span
          >
          <span style="display: inline-block;width: 50px">
            年龄：
          </span>
          <span
            style="
              display: inline-block;
              width: 70px;
              text-align: center;
              border-bottom: 1px solid rgb(220, 222, 226);
              height: 30px;
              margin-right: 5px;
            "
          >{{ this.$store.state.user.severFall.ageOrMonthAge }}</span
          >
          <span style="display: inline-block;width: 80px">
            科别(病区)：
          </span>
          <span
            style="
              display: inline-block;
              width: 150px;
              text-align: center;
              border-bottom: 1px solid rgb(220, 222, 226);
              height: 30px;
              margin-right: 5px;
            "
          >{{ this.data.ward_code }}</span
          >
          <span style="display: inline-block;width: 50px">
            床号：
          </span>
          <span
            style="
              display: inline-block;
              width: 50px;
              text-align: center;
              border-bottom: 1px solid rgb(220, 222, 226);
              height: 30px;
              margin-right: 5px;
            "
          >{{ this.data.bed_code }}</span
          >
          <span style="display: inline-block;width: 60px">
            住院号：
          </span>
          <span
            style="
              display: inline-block;
              width: 80px;
              text-align: center;
              border-bottom: 1px solid rgb(220, 222, 226);
              height: 30px;
            "
          >{{ this.data.visit_id }}</span
          >
        </div>
        <div style="margin-top: 10px">
          <div>
            <div class="title_one">建立/结束ECMO时间</div>
          </div>
          <div
            style="width: 840px; height: 30px; float: left; margin-top: 10px"
          >
            <span style="width: 100px; float: left; margin-left: 10px">

              <input
                v-model="info.gunluzi"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwensigou"
                style="width: 80px"
              />年
            </span>
            <span style="width: 100px; float: left; margin-left: 10px">

              <input
                v-model="info.buxiangshuijiaoa"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwensigou"
                style="width: 80px"
              />月
            </span>
            <span style="width: 100px; float: left; margin-left: 20px">

              <input
                v-model="info.nishishusiaa"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwensigou"
                style="width: 80px"
              />日
            </span>
            <span style="width: 100px; float: left; margin-left: 18px">

              <input
                v-model="info.gundanbazhongliu"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwensigou"
                style="width: 80px"
              />时
            </span>
            <span style="width: 100px; float: left; margin-left: 18px">

              <input
                v-model="info.tianxiafenhe"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwensigou"
                style="width: 80px"
              />分
            </span>
            <span style="width: 100px; float: left; margin-left: 10px">

              <input
                v-model="info.miaoshaaa"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwensigou"
                style="width: 80px"
              />秒
            </span>
          </div>
          <div>
            <div class="title_one">血流动力学参数：</div>
          </div>
          <div
            style="width: 840px; height: 30px; float: left; margin-top: 10px"
          >
            <span style="width: 100px; float: left; margin-left: 10px">
              HR
              <input
                v-model="info.hrr"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 10px">
              MBP
              <input
                v-model="info.mbp"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 20px">
              CVP
              <input
                v-model="info.cvpp"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 18px">
              CO
              <input
                v-model="info.co"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 18px">
              CI
              <input
                v-model="info.ci"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 10px">
              LAP
              <input
                v-model="info.lap"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 10px">
              PAP
              <input
                v-model="info.pap"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
          </div>
          <div>
            <div class="title_one">血气参数：</div>
          </div>
          <div
            style="width: 840px; height: 30px; float: left; margin-top: 10px"
          >
            <span style="width: 100px; float: left; margin-left: 10px">
              SvO2:
              <input
                v-model="info.svo2"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 30px">
              SaO2:
              <input
                v-model="info.sao2"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 30px">
              SpO2:
              <input
                v-model="info.spo2222"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 30px">
              PH:
              <input
                v-model="info.ph2"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 30px">
              K:
              <input
                v-model="info.k"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
          </div>
          <div
            style="width: 840px; height: 35px; float: left; margin-top: 10px"
          >
            <span style="width: 100px; float: left; margin-left: 10px">
              PaO2:
              <input
                v-model="info.bradePaO2nScore"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 30px">
              PaCO2:
              <input
                v-model="info.PaCO2"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 40px">
              HCO3:
              <input
                v-model="info.HCO3"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 30px">
              BE:
              <input
                v-model="info.BE"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 30px">
              Lac:
              <input
                v-model="info.Lac"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
          </div>
          <div>
            <div class="title_one">呼吸机参数：</div>
          </div>
          <div
            style="width: 840px; height: 35px; float: left; margin-top: 10px"
          >
            <span style="width: 100px; float: left; margin-left: 10px">
              VR
              <input
                v-model="info.VR"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 10px">
              FiO2:
              <input
                v-model="info.FiO2"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 20px">
              PIP:
              <input
                v-model="info.PIP"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 100px; float: left; margin-left: 18px">
              PEEP:
              <input
                v-model="info.PEEP"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
          </div>
          <div>
            <div class="title_one">心血管活性药：（μg/kg/min）</div>
          </div>
          <div
            style="width: 840px; height: 30px; float: left; margin-top: 10px"
          >
            <span style="width: 180px; float: left; margin-left: 10px">
              多巴胺：
              <input
                v-model="info.duolonggun"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 180px; float: left; margin-left: 30px">
              多巴酚丁胺：
              <input
                v-model="info.dinganji"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 180px; float: left; margin-left: 30px">
              肾上腺素：
              <input
                v-model="info.shenshangji"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
          </div>
          <div
            style="width: 840px; height: 35px; float: left; margin-top: 10px"
          >
            <span style="width: 180px; float: left; margin-left: 10px">
              去甲肾上腺素：
              <input
                v-model="info.jisuge"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 180px; float: left; margin-left: 30px">
              异丙肾上腺素：
              <input
                v-model="info.binggouzi"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 180px; float: left; margin-left: 40px">
              其他：
              <input
                v-model="info.qitale"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
          </div>
          <div style="width: 840px; height: 30px; float: left">
            <span style="width: 350px; float: left; margin-left: 10px">
              起博器：
              <input
                v-model="info.qiboji"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 250px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 350px; float: left; margin-left: 30px">
              IABP：
              <input
                v-model="info.IABP"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 250px"
              />
            </span>
          </div>
          <div>
            <div class="title_one">建立ECMO 的地点：</div>
          </div>
          <div
            style="width: 840px; height: 35px; float: left; margin-top: 10px"
          >
            <span style="width: 180px; float: left; margin-left: 10px">
              手术室：
              <input
                v-model="info.shoushus"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 180px; float: left; margin-left: 10px">
              ICU：
              <input
                v-model="info.icpcpcc"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 180px; float: left; margin-left: 20px">
              其他：
              <input
                v-model="info.shuib"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
          </div>
          <div style="width: 840px; height: 30px; float: left">
            <span style="width: 350px; float: left; margin-left: 10px">
              ECMO前有心肺复苏（＋/－）：
              <input
                v-model="info.fususl"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 150px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 350px; float: left; margin-left: 30px">
              瞳孔散大（＋/－）：
              <input
                v-model="info.tongkunddd"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 150px"
              />
            </span>
          </div>
          <div style="width: 840px; height: 30px; float: left">
            <span style="width: 350px; float: left; margin-left: 10px">
              ECMO期间心肺复苏持续时间：
              <input
                v-model="info.chisushij"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 150px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />（min）
            </span>
          </div>
          <div>
            <div class="title_one">
              ECMO模式：VA ------------- VV ------------
            </div>
          </div>
          <div
            style="width: 840px; height: 30px; float: left; margin-top: 10px"
          >
            <span style="width: 180px; float: left; margin-left: 10px">
              V：1.
              <input
                v-model="info.vvvq"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />Fr
            </span>
            <span style="width: 180px; float: left; margin-left: 30px">
              2.
              <input
                v-model="info.damugou"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />Fr
            </span>
            <span style="width: 180px; float: left; margin-left: 30px">
              3.
              <input
                v-model="info.xiaomuji"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />Fr
            </span>
          </div>
          <div
            style="width: 840px; height: 35px; float: left; margin-top: 10px"
          >
            <span style="width: 180px; float: left; margin-left: 10px">
              A: 1.
              <input
                v-model="info.haode"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />Fr
            </span>
            <span style="width: 180px; float: left; margin-left: 30px">
              2.
              <input
                v-model="info.buhaode"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />Fr
            </span>
            <span style="width: 180px; float: left; margin-left: 30px">
              3.
              <input
                v-model="info.kewu"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />Fr
            </span>
          </div>
          <div style="width: 840px; height: 30px; float: left">
            <span style="width: 350px; float: left; margin-left: 10px">
              氧合器型号：
              <input
                v-model="info.xongmgf"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 250px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 350px; float: left; margin-left: 30px">
              驱动泵型号：
              <input
                v-model="info.qudonghao"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 250px"
              />
            </span>
          </div>
          <div style="width: 840px; height: 30px; float: left">
            <span style="width: 350px; float: left; margin-left: 10px">
              麻醉：
              <input
                v-model="info.malegejide"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 550px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
          </div>
          <div>
            <div class="title_one">手术操作：</div>
          </div>
          <div
            style="width: 840px; height: 35px; float: left; margin-top: 10px"
          >
            <span style="width: 180px; float: left; margin-left: 10px">
              经皮：
              <input
                v-model="info.kopiss"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
                @dblclick.native="(dialogCheckVisible = true), checkout()"
              />
            </span>
            <span style="width: 180px; float: left; margin-left: 10px">
              切开：
              <input
                v-model="info.qiekai"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
            <span style="width: 180px; float: left; margin-left: 20px">
              经胸：
              <input
                v-model="info.jingxiong"
                autocomplete="off"
                spellcheck="false"
                type="text"
                class="tiwen"
                style="width: 80px"
              />
            </span>
          </div>
          <div>
            <div class="title_one">
              并发症：患者
              出血：血栓：感染：肝衰：肾衰：溶血：神经：精神：消化道
            </div>
            <div class="title_one" style="margin-left: 54px">
              系统 进气：插管：血栓：渗漏：泵管：泵头：氧合：电源：变温器
            </div>
          </div>
          <div style="margin-top: 24px">
            <div class="title_one">
              简要说明：<input
              v-model="info.shuoshusoss"
              autocomplete="off"
              spellcheck="false"
              type="text"
              class="tiwen"
              style="width: 550px"
              @dblclick.native="(dialogCheckVisible = true), checkout()"
            />
            </div>
          </div>
          <div style="margin-top: 20px">
            <div class="title_one">
              签名：
              <el-select
                v-model="info.qianminga"
                placeholder=""
                clearable
                filterable
                :filter-method="signFilter"
              >
                <el-option
                  v-for="item in signOptions"
                  :key="item.id"
                  :label="item.user_name"
                  :value="item.login_name"
                />
              </el-select>
            </div>
          </div>
        </div>
        <div style="text-align:center;margin-top: 16px;">第{{ this.pageNum }}页</div>
      </div>

      <!-- 按钮 -->
      <div
        style="
          position: fixed;
          right: 0;
          bottom: 0;
          z-index: 9;
          width: 100%;
          height: 56px;
          line-height: 56px;
          padding: 0 60px 0 18px;
          background: #fff;
          border-top: 1px solid #e8eaec;
          box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
        "
      >
        <el-button
          type="primary"
          style="position: absolute; right: 20px; top: 8px"
          @click="btn"
          :disabled=garbage
        >保存
        </el-button
        >

        <el-button
          type="primary"
          style="position: absolute; right: 102px; top: 8px"
          @click="adnursingPrint"
          :disabled=garbage
        >打印
        </el-button
        >

        <el-button
          type="primary"
          style="position: absolute; right: 185px; top: 8px"
          @click="record"
          :disabled=garbage
        >刷新
        </el-button
        >
        <el-button
          type="primary"
          style="position: absolute; right: 270px; top: 8px"
          @click="history()"
          :disabled=garbage
        >历史记录
        </el-button
        >
        <span style="position: absolute; right: 500px; top: 1px">
           设置页码：
        <input
          v-model="pageNum"
          autocomplete="off"
          spellcheck="false"
          type="text"
          placeholder=""
          oninput="value=value.replace(/[^0-9.]/g,'')"
          style="width: 100px;height: 30px;"
        />
        </span>
      </div>

      <!-- 历史记录-评估列表 -->
      <el-drawer title="评估列表" :visible.sync="drawerp">
        <el-table
          :data="historylist"
          style="width: 100%"
          stripe
          :header-cell-style="{
            background: '#d2e0f9',
            color: '#606266',
          }"
        >
          <el-table-column
            label="序号"
            type="index"
            align="center"
            width="80"
          />
          <el-table-column prop="createTime" label="评估时间" width="200"/>
          <el-table-column prop="operatorCode" label="评估人"/>
          <el-table-column label="操作" align="center" width="154">
            <template slot-scope="scope">
              <el-button
                slot="reference"
                size="mini"
                style="margin-left: 10px"
                type="primary"
                @click="choice(scope)"
              >选择
              </el-button
              >
              <el-popover
                :ref="`popover-${scope.$index}`"
                trigger="click"
                placement="top"
                width="100"
              >
                <p class="el-icon-warning">确定删除</p>
                <div style="text-align: right; margin: 0">
                  <el-button size="mini" type="text" @click="no(scope)"
                  >取消
                  </el-button
                  >
                  <el-button type="primary" size="mini" @click="yes(scope)"
                  >确定
                  </el-button
                  >
                </div>
                <el-button
                  slot="reference"
                  size="mini"
                  style="margin-left: 10px"
                  type="danger"
                >删除
                </el-button
                >
              </el-popover>
            </template>
          </el-table-column>
        </el-table>
      </el-drawer>
    </el-card>
  </div>
</template>

<script>
import {printExcel} from "@/utils/config"; //导入模块
import {jyxdPagePrint} from "@/utils/jyxd-page-printer.js";

import {
  hospitalizedAssessmentSaveData,
  getCodeListByName,
  getUserListByUserType,
  assessmentGetList, // 历史列表--分页查询列表
  assessmentChooseData, // 历史列表--选择
  assessmentDeleteData, // 历史列表--删除
  getTemplateNameAndAmount, // 护理记录--查询护理模板名称列表及其数量
  getListlei, // 根据条件查询护理类型列表（也可以不分页）
  nursingRecordEdit, // 护理记录--编辑一条护理记录
  getListByCode, // 护理记录--查询护理记录列表
  ecmoEstablishEndinsert,
  ecmoEstablishEndqueryList,
  ecmoEstablishEndqueryData,
  patientgetList,
  ecmoEstablishEnddeleteData, usergetList, findPage, getUserListByUserTypegetNurseList,

} from "@/api/table";
import {Message} from "element-ui";
import {edit} from "../../api/table";

export default {
  data() {
    return {
      selectLoading: false,
      pageNum: 1,
      age: "",
      printParam: {
        print_id: "print-div", //完整打印区域最外包裹, id名
        paper_height: "1240", //纸张长度，目前不自动分页，页面代码自行设计分页模式
        paper_width: "900", //纸张宽度，根据横向纵向调整，影响页面折行效果
        preview: "",
      },
      garbage: false,
      dialogVisiblePrint: false, // 打印预览
      drawerp: false, // 历史记录--评估列表
      historylist: [],
      user_name: "",
      data_time: "",

      drawerh: false, // 右侧弹窗--护理措施
      moban: "",
      value: "",
      idds: "",
      rightList: [],
      rightid: "",
      isActive: 0,
      s1: 0,
      s2: 0,
      tableDataRight: [],
      // 护理记录单
      tableDatarecord: [],
      start: 1, // 默认显示第几页
      totalCount: 0, // 总条数，根据接口获取数据长度(注意 : 这里不能为空)
      pgeSizes: [10, 20, 30, 40], // 个数选择器（可修改）
      PageSize: 10, // 默认每页显示的条数（可修改）

      data: {},
      nation: [],
      occupation: [],
      maritalStatus: [],
      education: [],
      isolationStatus: [],
      developmentalDegree: [],
      dietNursing: [],
      mentalNursing: [],
      safetyNursing: [],
      arrUserName: [],
      signOptions: [],
      nurseSignature: [],
      examineNurseSignature: [],
      dataTime: "",
      info: {
        type: "ecmo",
        visitId: "",
        visitCode: "",
        patientId: "",

        hrr: "",
        mbp: "",
        cvpp: "",
        co: "",
        ci: "",
        lap: "",
        pap: "",
        svo2: "",
        sao2: "",
        spo2222: "",
        ph2: "",
        k: "",
        bradePaO2nScore: "",
        PaCO2: "",
        HCO3: "",
        BE: "",
        Lac: "",
        VR: "",
        FiO2: "",
        PIP: "",
        PEEP: "",
        duolonggun: "",
        dinganji: "",
        shenshangji: "",
        jisuge: "",
        binggouzi: "",
        qitale: "",
        qiboji: "",
        IABP: "",
        shoushus: "",
        icpcpcc: "",
        shuib: "",
        fususl: "",
        tongkunddd: "",
        chisushij: "",
        vvvq: "",
        damugou: "",
        xiaomuji: "",
        haode: "",
        buhaode: "",
        kewu: "",
        xongmgf: "",
        qudonghao: "",
        malegejide: "",
        kopiss: "",
        qiekai: "",
        jingxiong: "",
        shuoshusoss: "",
        qianminga: "",
        gunluzi: "",
        buxiangshuijiaoa: "",
        nishishusiaa: "",
        gundanbazhongliu: "",
        tianxiafenhe: "",
        miaoshaaa: "",
      },
    };
  },
  watch: {
    getData: {
      handler(nVal) {
        this.data = this.$store.state.user.severFall;
        if (
          typeof this.data.patient_id != "string" ||
          this.data.patient_id.length < 1
        ) {
          alert("请选择一次病人");
        } else {
          this.huli();
        }
      },
      deep: true,
    },
  },
  created() {
    this.data = this.$store.state.user.severFall;

    this.getNowDate();
    if (
      typeof this.data.patient_id != "string" ||
      this.data.patient_id.length < 1
    ) {
      alert("请选择一次病人");
    } else {
      this.huli();
    }
  },
  methods: {
    signFilter(val) {
      this.value = val;
      if (val) { //val存在
        this.signOptions = this.arrUserName.filter((item) => {
          if (item.user_name.indexOf(val) >= 0 || item.login_name.indexOf(val) >= 0) {
            return true
          }
        })
      } else { //val为空时，还原数组
        Object.assign(this.signOptions, this.arrUserName);
      }
    },

    //设置页码
    findPageByPatientId() {
      findPage({
        patientId: this.data.patient_id,
      }).then((res) => {
        if (res.data != null && res.data.length > 0) {
          this.pageNum = res.data[0].pageNum;
        } else {
          this.pageNum = 1;
        }
      });

    },
    //vuex传值
    huli() {
      (this.info.visitId = this.data.visit_id),
        (this.info.visitCode = this.data.visit_code),
        (this.info.patientId = this.data.patient_id);
      //获取签名列表
      getUserListByUserTypegetNurseList({
        deptCode: this.$store.state.user.loginInfo.deptCode
      }).then((res) => {
        this.arrUserName = res.data;
        Object.assign(this.signOptions, res.data);
      });

      patientgetList({visitId: this.data.visit_id}).then((res) => {
        if (res.data[0].age !== '') {
          this.age = res.data[0].age;
        }
      });

      if (this.data.unplanned == "" || this.data.unplanned == null || this.data.unplanned == 0) {
        this.garbage = true;
        alert('请在首页补全患者信息')
        return;
      } else {
        this.garbage = false;
      }
      this.findPageByPatientId();
    },
    //获取当前时间
    getNowDate() {
      var date = new Date();
      // 年
      var year = date.getFullYear();
      // 月
      var month = date.getMonth() + 1;
      // 日
      var day = date.getDate();
      // 时
      var hh = date.getHours();
      // 分
      var mm = "";
      if (date.getMinutes() < 10) {
        mm = "0" + date.getMinutes();
      } else {
        mm = date.getMinutes();
      }
      // 秒
      var ss = "";
      if (date.getSeconds() < 10) {
        ss = "0" + date.getSeconds();
      } else {
        ss = date.getSeconds();
      }
      this.dataTime =
        year + "-" + month + "-" + day + " " + hh + ":" + mm + ":" + ss;
      this.info.dataTime = this.dataTime;
    },
    // 打印
    adnursingPrint() {
      if (
        typeof this.data.patient_id != "string" ||
        this.data.patient_id.length < 1
      ) {
        alert("请选择一次病人");
      } else {
        jyxdPagePrint(this.printParam);
      }
    },
    // 刷新
    record() {
      this.info = {
        type: "ecmo",
        visitId: "",
        visitCode: "",
        patientId: "",

        hrr: "",
        mbp: "",
        cvpp: "",
        co: "",
        ci: "",
        lap: "",
        pap: "",
        svo2: "",
        sao2: "",
        spo2222: "",
        ph2: "",
        k: "",
        bradePaO2nScore: "",
        PaCO2: "",
        HCO3: "",
        BE: "",
        Lac: "",
        VR: "",
        FiO2: "",
        PIP: "",
        PEEP: "",
        duolonggun: "",
        dinganji: "",
        shenshangji: "",
        jisuge: "",
        binggouzi: "",
        qitale: "",
        qiboji: "",
        IABP: "",
        shoushus: "",
        icpcpcc: "",
        shuib: "",
        fususl: "",
        tongkunddd: "",
        chisushij: "",
        vvvq: "",
        damugou: "",
        xiaomuji: "",
        haode: "",
        buhaode: "",
        kewu: "",
        xongmgf: "",
        qudonghao: "",
        malegejide: "",
        kopiss: "",
        qiekai: "",
        jingxiong: "",
        shuoshusoss: "",
        qianminga: "",
        gunluzi: "",
        buxiangshuijiaoa: "",
        nishishusiaa: "",
        gundanbazhongliu: "",
        tianxiafenhe: "",
        miaoshaaa: "",

      };
      this.getNowDate();
      if (
        typeof this.data.patient_id != "string" ||
        this.data.patient_id.length < 1
      ) {
        alert("请选择一次病人");
      } else {
        this.hui();
      }
    },

    // 保存
    btn() {
      if (
        typeof this.data.patient_id != "string" ||
        this.data.patient_id.length < 1
      ) {
        alert("请选择一次病人");
      } else {
        if (!this.info.patientId) {
          this.info.patientId = this.data.patient_id;

        }

        ecmoEstablishEndinsert(this.info).then((res) => {
          this.tableList = res.data;
          if (res.code === 200) {
            console.log(res);
            this.$message({
              message: res.msg,
              type: "success",
              duration: 1000,
            });
          } else {
            this.$message({
              message: res.msg,
              type: "error",
              duration: 1000,
            });
          }
        });
      }
    },
    // 历史记录  *----------*
    history() {
      if (
        typeof this.data.patient_id != "string" ||
        this.data.patient_id.length < 1
      ) {
        alert("请选择一次病人");
      } else {
        this.drawerp = true;
        if (this.info.patientId) {
          ecmoEstablishEndqueryList({
            status: 1,
            patientId: this.info.patientId,
            type: "ecmo",
          }).then((res) => {
            this.historylist = res.data;
          });
        }
      }
    },
    yes(scope) {
      // 可以在这里执行删除数据的回调操作.......删除操作......
      ecmoEstablishEnddeleteData({
        status: 1,
        rowId: scope.row.rowId,
      }).then((res) => {
        this.$message({
          message: "删除成功",
          type: "success",
        });
        this.history();
      });
      scope._self.$refs[`popover-${scope.$index}`].doClose();
    },
    no(scope) {
      this.$message("取消删除");
      scope._self.$refs[`popover-${scope.$index}`].doClose();
    },
    // 选择
    choice(scope) {
      this.ids = scope.row.rowId;
      ecmoEstablishEndqueryData({
        status: 1,
        rowId: this.ids,
        patientId: this.data.patient_id,
      }).then((res) => {
        this.info = res.data;
        this.info.type = "ecmo";
      });
    },
    handleChange() {
      let number = 0;
      this.checkedEquipments.map((item, index) => {
        if (!isNaN(item)) {
          number += item;
        }
      });
      this.num = number;

      this.checkEquipArr = [];
      const arr = this.checkedEquipments;
      for (let i = 0; i < arr.length; i++) {
        const equipment = arr[i];
        if (equipment.length > 0) {
          const obj = {
            id: this.equipments[i],
            equips: [],
          };
          for (let j = 0; j < equipment.length; j++) {
            obj.equips.push(equipment[j]);
          }
          this.checkEquipArr.push(obj);
        }
      }
      queryDataByTypeAndScore({type: this.datalist, score: this.num}).then(
        (res) => {
          this.font = res.data[0].description;
          this.frameElement = res.data[0].level;
          this.score = res.data[0].id;
        }
      );
      this.hulijilu = "Braden压疮评分:" + this.num + this.font;
    },
    //* ---------*

    //* 续页右侧弹框开始*
    rigthDiongs() {
      alert("2223");
    },
    // 获取续页右侧护理记录id
    son(item, index) {
      this.rightid = item.id;
      this.isActive = index;
      this.s1 = index;
      this.s2 = index;
      getListlei({
        templateItemName: "",
        templateId: this.rightid,
        size: this.PageSize,
        start: this.start,
      }).then((res) => {
        this.tableDataRight = res.data;
        this.totalCount = res.totalCount;
      });
    },
    // 护理单table接口
    getListlei(n1, n2) {
      getListlei({
        templateItemName: "",
        templateId: this.rightid,
        size: n1,
        start: n2,
      }).then((res) => {
        this.tableDataRight = res.data;
        this.totalCount = res.totalCount;
      });
    },
    // 分页
    handleSizeChange(val) {
      // 改变每页显示的条数
      this.PageSize = val;
      this.getListlei(val, 1);
      this.start = 1;
    },
    // 显示第几页
    handleCurrentChange(val) {
      this.start = val;
      this.getListlei(this.PageSize, this.start);
    },
    // 右侧弹窗搜索
    btnRight() {
      getListlei({templateItemName: this.moban}).then((res) => {
        this.tableDataRight = res.data;
      });
    },
    // 右侧护理记录·选择
    setLine(index) {
      console.log(index, "index");
      this.centent = index.content;
      nursingRecordEdit({
        id: this.idds,
        dataTime: this.time + " " + this.timesss + ":00",
        content: index.content,
        operatorCode: this.names,
      }).then((res) => {
        this.recode();
      });
    },

    // 方便调用
    recode() {
      getListByCode({
        code: "nursingRecordContent",
        status: 1,
        patientId: this.info.patient_id,
      }).then((res) => {
        this.tableDatarecord = res.data;
      });
    },
    //* 续页右侧弹框结束*
  },
};
</script>

<style scoped>
.line {
  text-align: center;
}

.block {
  position: absolute;
  top: 39px;
  right: 14%;
}

.warp {
  width: 840px;
  height: 1050px;
  /* border: 1px solid #000; */
  margin: 0 auto;
}

.title_one {
  font-size: 14px;
  font-weight: 900;
  margin-top: 5px;
  margin-bottom: 5px;
}

.one {
  width: 100px;
  display: block;
  float: left;
}

.app-container /deep/ .el-input__inner {
  border: none;
  border-bottom: 1px solid #dcdfe6;
}

.tiwen {
  width: 30px;
  border: 0px;
  border-bottom: 1px solid #dcdfe6;
  outline: none;
  position: absolute;
}

.tiwensigou {
  width: 30px;
  border: 0px;
  border-bottom: 1px solid #dcdfe6;
}

.el-checkbox {
  margin-right: 19px !important;
}

.spp .el-checkbox {
  margin-right: 60px !important;
}

.spps .customer-checkbox {
  margin-right: 60px !important;
}

.mod_box {
  margin-top: -60px;
  width: 2150px;
  margin-left: 15%;
}

.mod_box1 {
  margin-top: -60px;
  width: 75%;
  margin-left: 15%;
}

.mod_box2 {
  margin-top: -60px;
  width: 1800px;
  margin-left: 15%;
}

.morse-cri {
  height: 50px;
  line-height: 60px;
}

.morseTj {
  height: 60px;
}

.morse {
  float: left;
  font-size: 16px;
  font-weight: 700;
  color: #303133;
  margin-top: 1px;
}

.morsePrint {
  height: 50px;
  border-bottom: 1px solid #e8eaec;
}

.morseText {
  float: left;
  font-size: 18px;
  margin-top: 16px;
  color: #17233d;
  font-weight: 500;
}

.morse1 {
  float: right;
  font-size: 16px;
  font-weight: 700;
  color: #303133;
  margin-top: 1px;
  margin-right: 40px;
}

.Scoring {
  float: right;
}

.Synchronize {
  display: inline-block;
  margin-bottom: 15px;
}

.Nursing {
  display: inline-block;
  line-height: 54px;
  height: 70px;
}

.newadd {
  height: 40px;
  color: #fff;
  line-height: 15px;
  text-align: center;
  position: relative;
  font-size: 15px;
  border-radius: 5px;
  display: inline-block;
  background: #19be6b;
  float: right;
}

.role-mask {
  border-radius: 6px;
}

.role-mask .el-dialog__header {
  border-bottom: 1px solid #e8eaec;
}

.role-mask .el-dialog__body {
  padding: 0px 20px 15px;
  color: #606266;
  font-size: 14px;
  word-break: break-all;
}

.role-mask .el-dialog__footer {
  border-top: 1px solid #e8eaec;
}

/* 续页右侧护理记录开始*/
.paging {
  float: left;
  margin-top: 22px;
  margin-bottom: 30px;
  /* margin-left: 54%; */
}

.modelBox {
  height: 175px;
  width: 90%;
  margin: 25px 0px 15px 40px;
}

#modelItem {
  width: 118px;
  height: 77px;
  float: left;
  margin-right: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
  border: 1px solid #dcdee2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
}

#modelItem span {
  margin: 0 auto;
  display: inline-block;
  width: 110px;
  height: 20px;
  text-align: center;
  line-height: 20px;
}

#text {
  font-weight: 500;
}

#textn {
  font-size: 14px;
  font-weight: normal;
  color: #6a6b6d;
}

.isActive {
  box-shadow: rgb(92, 173, 255) 0px 0px 3px;
  background-color: rgb(45, 140, 240);
}

.s1 {
  color: #fff;
}

.s2 {
  color: #fff;
}

.jiansuo-box {
  width: 94%;
  margin: auto;
  background: aliceblue;
  height: 80px;
  border-radius: 5px;
  border: 1px solid #dcdee2;
  text-align: center;
  line-height: 80px;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}

.kaiguan {
  display: inline-block;
  margin-left: 5px;
}

.kuangBox {
  display: inline;
  margin-right: 9%;
}

.span_top {
  position: relative;
  font-size: 15px;
  line-height: 50px;
}

.bed {
  width: 200px;
  position: relative;
  left: 0%;
}

/* 续页右侧护理记录结束*/
@media screen and (min-width: 1200px) and (max-width: 1365px) {
  .mod_box2 {
    width: 1800px;
    margin-left: -18%;
  }
}

@media screen and (min-width: 1366px) and (max-width: 1600px) {
  .mod_box2 {
    width: 1800px;
    margin-left: -9%;
  }
}

@media screen and (min-width: 1800px) {
  .mod_box2 {
    width: 1800px;
    margin-left: 7%;
  }
}
</style>

